package cn.guet.zuul.filter;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Component;

import com.netflix.zuul.ZuulFilter;

/**
 * 路由前过滤器
 *
 * @author SAGITTAR
 */
@Component
public class ZuulPreFilter extends ZuulFilter {

    private static final Logger LOGGER = LogManager.getLogger(ZuulPreFilter.class);

    @Override
    public Object run() {
        LOGGER.info("pre");
        return null;
    }

    @Override
    public boolean shouldFilter() {
        return true;
    }

    @Override
    public int filterOrder() {
        return 0;
    }

    @Override
    public String filterType() {
        return "pre";
    }
}
